import { postForm, get, put } from '@/utils/request'

// 获取列表
export function getRecords(listQuery) {
  return get('/article/section/list/page', listQuery)
}

// 获取可发布的文章栏目
export function getChildSections() {
  return get('/article/section/list', { isNode: 0 })
}

export function add(optData) {
  return postForm('/article/section', optData)
}

export function edit(optData) {
  return put('/article/section', optData)
}

export function del(ids) {
  return postForm('/article/section/del/batch', { pkIds: JSON.stringify(ids) })
}

// 获取列表channel
export function getSectionTableTree(listQuery) {
  return get('/article/section/table/tree', listQuery)
}

export default { add, edit, del }
